package cn.csdj.sism.web;

import cn.csdj.sism.pojo.StudentClass;
import cn.csdj.sism.pojo.Studentscore;
import cn.csdj.sism.service.StudentClassService;
import cn.csdj.sism.service.StudentscoreService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/**
 * Controller实现类
 * 李心怡
 * 2023/4/10
 */
@CrossOrigin
@RestController
@RequestMapping("/studentClass")
public class StudentClassController {
    @Autowired
    private StudentClassService studentClassService;
    @PostMapping
    public void insert(@RequestBody StudentClass studentClass){
        studentClassService.insert(studentClass);
    }
    @DeleteMapping("/{id}")
    public void deleteById(@PathVariable Integer id){
        studentClassService.deleteById(id);
    }
    @PutMapping
    public void update(@RequestBody StudentClass studentClass){
        studentClassService.update(studentClass);
    }
    @GetMapping("/{id}")
    public StudentClass selectById(@PathVariable Integer id){
        return studentClassService.selectById(id);
    }
    @GetMapping
    public List<StudentClass> selectAll(){
        return studentClassService.selectAll();
    }
}
